package com.le.tester.tip;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * createTime：2023/7/14 14:31
 * description：stream源,使用new Object后再使用stream,将不会NPE,
 * 使用null 结果反之
 */
public class StreamSourceNull {

    public static void main(String[] args) {
//        List<Integer> integers = new ArrayList<>();
//
//        integers = integers.stream().filter(item -> item > 10).collect(Collectors.toList());
//
//        System.out.println(integers);
        Integer prodCateId = 90;
        List<Integer> integers = Lists.newArrayList(78, 98, 98, 90, 90);
        long count = integers.stream().filter(prodCateId::equals).count();
        System.out.println(count);

    }
}
